﻿using Abp.Domain.Entities.Auditing;
using Sunlit.Business.Authorization.Users;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Sunlit.Business.Enterprises
{
    [Table("AbpEnterpriseMessages")]
    public class EnterpriseMessage : CreationAuditedEntity<long>
    {
        /// <summary>
        /// 留言联系人
        /// </summary>
        [StringLength(32)]
        public string LinkMan { get; set; }
        /// <summary>
        /// 留言人电话
        /// </summary>
        [StringLength(32)]
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 留言内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 留言文章ID
        /// </summary>
        public long EnterpriseId { get; set; }
        [ForeignKey(nameof(EnterpriseId))]
        public virtual Enterprise Enterprise { get; set; }
        /// <summary>
        /// 留言接收者ID
        /// </summary>
        public long? ReceiverId { get; set; }
        [ForeignKey(nameof(ReceiverId))]
        public virtual User Receiver { get; set; }
    }
}
